<template>
  <div class="pannel">
    <DoggyGlobe
      v-for="(item, index) in list"
      :key="index"
      :url="item.dogImgUrl"
      :uname="item.dogName"
      @love="clickFn"
    ></DoggyGlobe>
    <hr />
    <p>显示喜欢的狗:</p>
    <ul>
      <li v-for="(item, index) in newList" :key="index">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
import DoggyGlobe from './components/doggy'
export default {
  data() {
    return {
      list: [
        {
          dogImgUrl:
            'http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg',
          dogName: '博美',
        },
        {
          dogImgUrl:
            'https://img0.baidu.com/it/u=3802949389,3478150720&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=266',
          dogName: '泰迪',
        },
        {
          dogImgUrl:
            'http://t15.baidu.com/it/u=871319489,4095416126&fm=224&app=112&f=JPEG?w=500&h=495',
          dogName: '金毛',
        },
        {
          dogImgUrl:
            'https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c',
          dogName: '哈士奇',
        },
        {
          dogImgUrl:
            'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.zhimg.com%2Fv2-f3b7b0baa4beda93adc179adfe764a60_r.jpg&refer=http%3A%2F%2Fpic1.zhimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1665227420&t=3f57923daa3af001dfaf9c49072a9af1',
          dogName: '阿拉斯加',
        },
        {
          dogImgUrl:
            'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F13552822323%2F1000.jpg&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1665227448&t=1989f756fbc74037d14071ca98d493e3',
          dogName: '萨摩耶',
        },
      ],
      newList: [],
    }
  },
  methods: {
    clickFn(uname) {
      this.newList.push(uname)
    },
  },
  components: {
    DoggyGlobe,
  },
}
</script>

<style>
.pannel {
  display: flex;
  flex-wrap: wrap;
}
</style>
